package com.cheng.frame;

import java.awt.Color;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.BevelBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.border.TitledBorder;

import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;

public class PriInfoPanel extends JPanel{
	private static final long serialVersionUID = 1L;
	private PriInfoPanel priInfoPanel;
	private JLabel jLabel5;
	private JLabel jLabel6;
	private JComboBox tQuestion;
	private JTextField tAnswer;
	
	public PriInfoPanel(){
		priInfoPanel = this;
		priInfoPanel.setBorder(BorderFactory.createTitledBorder(null, "隐蔽信息", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION,
				new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
		priInfoPanel.setLayout(new GroupLayout());
		priInfoPanel.add(getJLabel5(), new Constraints(new Leading(50, 65, 10, 10), new Leading(10, 30, 10, 10)));
		priInfoPanel.add(getJLabel6(), new Constraints(new Leading(50, 65, 10, 10), new Leading(55, 30, 10, 10)));
		priInfoPanel.add(getTQuestion(), new Constraints(new Leading(135, 175, 10, 10), new Leading(10, 30, 10, 10)));
		priInfoPanel.add(getTAnswer(), new Constraints(new Leading(135, 175, 10, 10), new Leading(55, 30, 10, 10)));
	}
	
	public PriInfoPanel getPanel() {
		if (priInfoPanel == null) {
			priInfoPanel = new PriInfoPanel();
			
		}
		return priInfoPanel;
	}
	
	public JComboBox getTQuestion() {
		if (tQuestion == null) {
			tQuestion = new JComboBox();
			tQuestion.setEditable(true);
			tQuestion.setModel(new DefaultComboBoxModel(new Object[] { "请输入或选择隐蔽问题", "你父亲的生日月份是？", "你最喜欢的颜色是？", "你最喜欢的一首歌是？" }));
			tQuestion.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
		}
		return tQuestion;
	}
	
	public JTextField getTAnswer() {
		if (tAnswer == null) {
			tAnswer = new JTextField();
		}
		return tAnswer;
	}
	
	private JLabel getJLabel6() {
		if (jLabel6 == null) {
			jLabel6 = new JLabel();
			jLabel6.setText("答案");
		}
		return jLabel6;
	}

	private JLabel getJLabel5() {
		if (jLabel5 == null) {
			jLabel5 = new JLabel();
			jLabel5.setText("问题");
		}
		return jLabel5;
	}
	
}
